package ru.jexp.rcp.supply.beans.nakl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import ru.jexp.kontragent.Kontragent;
import ru.jexp.ucet.nakladnaa.StrokaNakladnoi;

public class WizardNaklModel {

	private Date date;
	private String number;
	private Kontragent supplier;
	private List<StrokaNakladnoiWrap> listDetail;
	private List<StrokaNakladnoiWrap> listMaterial;
	private List<StrokaNakladnoiWrap> listPki;

	public void setDate(Date date) {
		this.date = date;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public void setSupplier(Kontragent supplier) {
		this.supplier = supplier;
	}

	public String getNumber() {
		return number;
	}

	public Date getDate() {
		return date;
	}

	public Kontragent getSupplier() {
		return supplier;
	}

	public void setListDetail(List<StrokaNakladnoiWrap> listDetail) {
		this.listDetail = listDetail;
	}
	
	public void setListMaterial(List<StrokaNakladnoiWrap> listMaterial) {
		this.listMaterial = listMaterial;
	}
	
	public void setListPki(List<StrokaNakladnoiWrap> listPki) {
		this.listPki = listPki;
	}
	
	public List<StrokaNakladnoi> getListNaklStrDetail() {
		return getUnwrapList(listDetail);
	}

	public List<StrokaNakladnoi> getListNaklStrMaterial() {
		return getUnwrapList(listMaterial);
	}

	public List<StrokaNakladnoi> getListNaklStrPki() {
		return getUnwrapList(listPki);
	}

	private List<StrokaNakladnoi> getUnwrapList(
			List<StrokaNakladnoiWrap> listWrap) {
		List<StrokaNakladnoi> list = new ArrayList<StrokaNakladnoi>();
		for (StrokaNakladnoiWrap strWrap : listWrap) {
			list.add(strWrap.getStrokaNakl());
		}
		return list;
	}

}
